var sequelize = require('../mysql.js');
var Sequelize = require('sequelize');

var Book = sequelize.define('book',
    {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true
        },
        name: {
            type: Sequelize.STRING
        },
        author: {
            type: Sequelize.STRING
        },
        price: {
            type: Sequelize.FLOAT
        }
    },

    {
        indexes: [
            {
                unique: true,
                fields: ['name']
            }
        ]
    }
);

module.exports = Book;